<template>
  <m-modal
    v-model="visible"
    title="新增内容"
    :width="300"
    :left="x"
    :top="y"
    @ok="handleOk"
    @cancel="handleCancel">
    <div class="g-pd-20">

      <a-input v-model="curText" type="textarea" :autoSize="{ minRows: 6, maxRows: 6 }"/>
    </div>
  </m-modal>
</template>
<script>
import { Portal } from 'src/components/common/Portal.vue';
import Modal from 'src/components/common/CustomModal';

const comp  = {
  name: 'comp-text-modal',
  components: {
    'm-modal': Modal,

  },
  props: {
    text: String,
    x: Number,
    y: Number
  },
  data() {
    return {
      curText: this.text,
      visible: false,
     
    };
  },
  mounted(){
    this.visible = true;

  },
  methods: {
    handleOk(){
      this.visible = false;
			
      this.$emit('sure', { value: this.curText });
    },
    handleCancel(){
      this.visible = false;
      this.$emit('close');
    },
  }
};
export default comp;
export const textModal = new Portal(comp, { single: true });
</script>
<style lang="scss">
</style>